package adv5.exec;

import java.io.Serializable;

public class Staff implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// 公司有很多员工（用List存储，作为公司的一部分），员工有姓名，年龄，性别，职务，薪水、工号等属性
	private String name;
	private int age;
	private String sex;
	private String work;
	private double xinshui;
	private String workNum;

	public Staff() {

	}

	public Staff(String name, int age, String sex, String work, int xinshui, String workNum) {
		super();
		this.name = name;
		this.age = age;
		this.sex = sex;
		this.work = work;
		this.xinshui = xinshui;
		this.workNum = workNum;
	}

	public void Staffshow() {
		System.out.println("员工姓名：" + this.name + ",年龄是：" + this.age + "岁，性别：" + this.sex + ",职务是：" + this.work + ",薪水："
				+ this.xinshui + ",工号是：" + this.workNum);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getWork() {
		return work;
	}

	public void setWork(String work) {
		this.work = work;
	}

	public double getXinshui() {
		return xinshui;
	}

	public void setXinshui(double xinshui) {
		this.xinshui = xinshui;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((workNum == null) ? 0 : workNum.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Staff other = (Staff) obj;
		if (workNum == null) {
			if (other.workNum != null)
				return false;
		} else if (!workNum.equals(other.workNum))
			return false;
		return true;
	}

	public String getWorkNum() {
		return workNum;
	}

	public void setWorkNum(String workNum) {
		this.workNum = workNum;
	}

}